/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JDialogFamilyBackground.java
 *
 * Created on 14/09/2010, 23:39:08
 */
package systole.view.crud.patient.patientComponents.familyBackground;

import org.jdesktop.application.Action;

/**
 *
 * @author jmj
 */
public class JDialogFamilyBackground extends javax.swing.JDialog {

    private ControllerEditionFamilyBackground controller;

    /** Creates new form JDialogFamilyBackground */
    public JDialogFamilyBackground(java.awt.Frame parent, ControllerEditionFamilyBackground controller) {
        super(parent, true);
        initComponents();
        this.controller = controller;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jpnlCenter = new javax.swing.JPanel();
        jPnlBackground = new javax.swing.JPanel();
        jChkCardiac = new javax.swing.JCheckBox();
        jChkHypertension = new javax.swing.JCheckBox();
        jChkDiabetic = new javax.swing.JCheckBox();
        jChkCholesterol = new javax.swing.JCheckBox();
        cmbRelatives = new javax.swing.JComboBox();
        lblRelative = new javax.swing.JLabel();
        jPnlBottom = new javax.swing.JPanel();
        jBtnOk = new javax.swing.JButton();
        jBtnCancel = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setModal(true);
        setName("Form"); // NOI18N
        setResizable(false);

        jpnlCenter.setName("jpnlCenter"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(systole.view.SystoleApp.class).getContext().getResourceMap(JDialogFamilyBackground.class);
        jPnlBackground.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(resourceMap.getColor("jPnlBackground.border.border.lineColor"), 1, true), resourceMap.getString("jPnlBackground.border.title"))); // NOI18N
        jPnlBackground.setName("jPnlBackground"); // NOI18N
        jPnlBackground.setPreferredSize(new java.awt.Dimension(120, 80));

        jChkCardiac.setText(resourceMap.getString("jChkCardiac.text")); // NOI18N
        jChkCardiac.setToolTipText(resourceMap.getString("jChkCardiac.toolTipText")); // NOI18N
        jChkCardiac.setName("jChkCardiac"); // NOI18N

        jChkHypertension.setText(resourceMap.getString("jChkHypertension.text")); // NOI18N
        jChkHypertension.setToolTipText(resourceMap.getString("jChkHypertension.toolTipText")); // NOI18N
        jChkHypertension.setName("jChkHypertension"); // NOI18N

        jChkDiabetic.setText(resourceMap.getString("jChkDiabetic.text")); // NOI18N
        jChkDiabetic.setToolTipText(resourceMap.getString("jChkDiabetic.toolTipText")); // NOI18N
        jChkDiabetic.setName("jChkDiabetic"); // NOI18N

        jChkCholesterol.setText(resourceMap.getString("jChkCholesterol.text")); // NOI18N
        jChkCholesterol.setToolTipText(resourceMap.getString("jChkCholesterol.toolTipText")); // NOI18N
        jChkCholesterol.setName("jChkCholesterol"); // NOI18N

        javax.swing.GroupLayout jPnlBackgroundLayout = new javax.swing.GroupLayout(jPnlBackground);
        jPnlBackground.setLayout(jPnlBackgroundLayout);
        jPnlBackgroundLayout.setHorizontalGroup(
            jPnlBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPnlBackgroundLayout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(jPnlBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jChkHypertension)
                    .addComponent(jChkCardiac))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 66, Short.MAX_VALUE)
                .addGroup(jPnlBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jChkCholesterol)
                    .addComponent(jChkDiabetic))
                .addGap(22, 22, 22))
        );
        jPnlBackgroundLayout.setVerticalGroup(
            jPnlBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlBackgroundLayout.createSequentialGroup()
                .addGroup(jPnlBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPnlBackgroundLayout.createSequentialGroup()
                        .addComponent(jChkCholesterol)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jChkDiabetic))
                    .addGroup(jPnlBackgroundLayout.createSequentialGroup()
                        .addComponent(jChkCardiac)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jChkHypertension)))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        cmbRelatives.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        cmbRelatives.setToolTipText(resourceMap.getString("cmbRelatives.toolTipText")); // NOI18N
        cmbRelatives.setName("cmbRelatives"); // NOI18N

        lblRelative.setFont(lblRelative.getFont().deriveFont(lblRelative.getFont().getStyle() | java.awt.Font.BOLD));
        lblRelative.setText(resourceMap.getString("lblRelative.text")); // NOI18N
        lblRelative.setName("lblRelative"); // NOI18N

        javax.swing.GroupLayout jpnlCenterLayout = new javax.swing.GroupLayout(jpnlCenter);
        jpnlCenter.setLayout(jpnlCenterLayout);
        jpnlCenterLayout.setHorizontalGroup(
            jpnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnlCenterLayout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addGroup(jpnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpnlCenterLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblRelative)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cmbRelatives, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPnlBackground, javax.swing.GroupLayout.PREFERRED_SIZE, 284, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(37, Short.MAX_VALUE))
        );
        jpnlCenterLayout.setVerticalGroup(
            jpnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnlCenterLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblRelative)
                    .addComponent(cmbRelatives, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPnlBackground, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(4, 4, 4))
        );

        getContentPane().add(jpnlCenter, java.awt.BorderLayout.CENTER);

        jPnlBottom.setName("jPnlBottom"); // NOI18N
        jPnlBottom.setPreferredSize(new java.awt.Dimension(174, 40));

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(systole.view.SystoleApp.class).getContext().getActionMap(JDialogFamilyBackground.class, this);
        jBtnOk.setAction(actionMap.get("ok")); // NOI18N
        jBtnOk.setText(resourceMap.getString("jBtnOk.text")); // NOI18N
        jBtnOk.setToolTipText(resourceMap.getString("jBtnOk.toolTipText")); // NOI18N
        jBtnOk.setName("jBtnOk"); // NOI18N
        jPnlBottom.add(jBtnOk);

        jBtnCancel.setAction(actionMap.get("cancel")); // NOI18N
        jBtnCancel.setText(resourceMap.getString("jBtnCancel.text")); // NOI18N
        jBtnCancel.setToolTipText(resourceMap.getString("jBtnCancel.toolTipText")); // NOI18N
        jBtnCancel.setName("jBtnCancel"); // NOI18N
        jPnlBottom.add(jBtnCancel);

        getContentPane().add(jPnlBottom, java.awt.BorderLayout.SOUTH);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox cmbRelatives;
    private javax.swing.JButton jBtnCancel;
    private javax.swing.JButton jBtnOk;
    private javax.swing.JCheckBox jChkCardiac;
    private javax.swing.JCheckBox jChkCholesterol;
    private javax.swing.JCheckBox jChkDiabetic;
    private javax.swing.JCheckBox jChkHypertension;
    private javax.swing.JPanel jPnlBackground;
    private javax.swing.JPanel jPnlBottom;
    private javax.swing.JPanel jpnlCenter;
    private javax.swing.JLabel lblRelative;
    // End of variables declaration//GEN-END:variables

   
    /**
     * @return the cmbRelatives
     */
    public javax.swing.JComboBox getCmbRelatives() {
        return cmbRelatives;
    }

    /**
     * @return the jChkCardiac
     */
    public javax.swing.JCheckBox getjChkCardiac() {
        return jChkCardiac;
    }

    /**
     * @return the jChkCholesterol
     */
    public javax.swing.JCheckBox getjChkCholesterol() {
        return jChkCholesterol;
    }

    /**
     * @return the jChkDiabetic
     */
    public javax.swing.JCheckBox getjChkDiabetic() {
        return jChkDiabetic;
    }

    /**
     * @return the jChkHypertension
     */
    public javax.swing.JCheckBox getjChkHypertension() {
        return jChkHypertension;
    }    

    /**
     * Confirm operation
     */
    @Action
    public void ok() {
        this.controller.ok();
    }

    /**
     * Cancel operation
     */
    @Action
    public void cancel() {
        this.controller.cancel();
    }
}
